package com.example.a33mvvm.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.a33mvvm.R;
import com.example.a33mvvm.utils.ImageLoader;
import com.example.base_mvvm.entity.CommentEntity;
import com.example.base_mvvm.entity.VideoEntity;

import java.util.List;

public class CommentAdapter extends BaseQuickAdapter<CommentEntity.DataBean, BaseViewHolder> {
    public CommentAdapter(@Nullable List<CommentEntity.DataBean> data) {
        super(R.layout.comment_item, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CommentEntity.DataBean dataBean) {
        ImageView view = baseViewHolder.getView(R.id.comment_iv);
        ImageLoader.getInstance().LoadCircleImage(getContext(),dataBean.getIcon(),view);
        baseViewHolder.setText(R.id.comment_authname,dataBean.getUsername());
        baseViewHolder.setText(R.id.comment_message,dataBean.getMsg());
        baseViewHolder.setText(R.id.comment_time,dataBean.getCreatetime());
    }
}
